package com.zzh.controller;

import com.zzh.entity.Result;
import com.zzh.service.BianceAnnouncement;
import com.zzh.service.TwitterMonitorService;
import com.zzh.utils.ResultUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wenrouyue
 * @FileName: test
 * @description
 * @create 2023/4/27-11:49
 **/
@RestController
public class Test {

    @Resource
    private TwitterMonitorService twitterMonitorService;

    @Resource
    private BianceAnnouncement bianceAnnouncement;

    @RequestMapping("/twitter")
    public Result<List<String>> searchMessage() {
        return twitterMonitorService.searchMessage();
    }

    @GetMapping("/add/{username}")
    public Result<String> addUser(@PathVariable String username) {
        return twitterMonitorService.addUser(username);
    }

    @GetMapping("/del/{username}")
    public Result<String> delUser(@PathVariable String username) {
        return twitterMonitorService.delUser(username);
    }

    @RequestMapping("/biance")
    public Result<String> searchAnnouncement() {
        return bianceAnnouncement.searchAnnouncement();
    }
}
